/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package com.googlecode.ivybeans.module.customizer;

import com.googlecode.ivybeans.module.customizer.IvyLibraryUi.EditMediator;
import org.netbeans.api.project.Project;

/**
 *
 * @author  lforet
 */
public class CustomizerIvy extends javax.swing.JPanel {

    IvyLibraryUi.EditMediator editMediator;

    /** Creates new form CustomizerIvy */
    public CustomizerIvy(Project project) {
        initComponents();
        editMediator = IvyLibraryUi.registerEditMediatorProject(project, ivyEnabledCheck, ivyFileBtn, ivyFileTxt, settingsFileBtn, settingsFileTxt, autoResolveCheck, confTable);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        ivyFileLbl = new javax.swing.JLabel();
        ivyFileBtn = new javax.swing.JButton();
        ivyFileTxt = new javax.swing.JTextField();
        ivyEnabledCheck = new javax.swing.JCheckBox();
        settingsFileLbl = new javax.swing.JLabel();
        settingsFileTxt = new javax.swing.JTextField();
        settingsFileBtn = new javax.swing.JButton();
        confScrollPane = new javax.swing.JScrollPane();
        confTable = new javax.swing.JTable();
        autoResolveCheck = new javax.swing.JCheckBox();

        ivyFileLbl.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.ivyFileLbl.text")); // NOI18N

        ivyFileBtn.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.ivyFileBtn.text")); // NOI18N

        ivyFileTxt.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.ivyFileTxt.text")); // NOI18N

        ivyEnabledCheck.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.ivyEnabledCheck.text")); // NOI18N
        ivyEnabledCheck.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ivyEnabledCheckActionPerformed(evt);
            }
        });

        settingsFileLbl.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.settingsFileLbl.text")); // NOI18N

        settingsFileTxt.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.settingsFileTxt.text")); // NOI18N

        settingsFileBtn.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.settingsFileBtn.text")); // NOI18N

        confTable.setColumnSelectionAllowed(true);
        confTable.getTableHeader().setReorderingAllowed(false);
        confScrollPane.setViewportView(confTable);
        confTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        autoResolveCheck.setText(org.openide.util.NbBundle.getMessage(CustomizerIvy.class, "CustomizerIvy.autoResolveCheck.text")); // NOI18N

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(autoResolveCheck)
                    .add(confScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                        .add(ivyEnabledCheck)
                        .add(layout.createSequentialGroup()
                            .add(ivyFileLbl)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(ivyFileTxt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 329, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(ivyFileBtn))
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                            .add(settingsFileLbl)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(settingsFileTxt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 329, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(settingsFileBtn))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(ivyEnabledCheck)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(ivyFileLbl)
                    .add(ivyFileBtn)
                    .add(ivyFileTxt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(settingsFileBtn)
                    .add(settingsFileLbl)
                    .add(settingsFileTxt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(autoResolveCheck)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(confScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 139, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

private void ivyEnabledCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ivyEnabledCheckActionPerformed
}//GEN-LAST:event_ivyEnabledCheckActionPerformed

   
    public EditMediator getEditMediator() {
        return editMediator;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox autoResolveCheck;
    private javax.swing.JScrollPane confScrollPane;
    private javax.swing.JTable confTable;
    private javax.swing.JCheckBox ivyEnabledCheck;
    private javax.swing.JButton ivyFileBtn;
    private javax.swing.JLabel ivyFileLbl;
    private javax.swing.JTextField ivyFileTxt;
    private javax.swing.JButton settingsFileBtn;
    private javax.swing.JLabel settingsFileLbl;
    private javax.swing.JTextField settingsFileTxt;
    // End of variables declaration//GEN-END:variables
}
